<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欢迎登录</title>
    <link rel="stylesheet" href="../public/css/bootstrap.css">
    <style>
        .wraper{
            margin: 140px auto;
            width: 50%;
        }
        .wraper h1{
            text-align: center;
            font-weight: bold;
            color: rgb(0, 0, 0);
            text-shadow: 10px 5px 10px silver;
        }
        .wraper > div{
            border: 1px solid #f0f0f0;
            border-radius: 10px;
            padding: 15px 20px 0 15px;
            box-shadow: 0 0 10px rgb(230, 230, 230);
        }
        .wraper p{
            border-radius: 5px;
            border: 1px solid #f0f0f0;
            padding: 10px 20px;
            margin-top: 20px;
            box-shadow: 0 0 10px rgb(230, 230, 230);
        }
    </style>
</head>
<body>
    <div class="wraper">
        <h1>欢迎登录</h1>
        <div class="">
            <form action="/login" method="GET">
                <div class="form-group">
                    <label for="email" class="">邮箱</label>
                    <div class="">
                        <input type="text" class="form-control" id="email"
                        placeholder="Email" name="email">
                    </div>
                </div>
                <div class="form-group">
                    <label for="password" class="">密码</label>
                    <div class="">
                        <input type="text" class="form-control" id="password"
                        placeholder="PassWord" name="password">
                    </div>
                </div>
                <div class="form-group">
                    <div class="">
                        <input type="checkbox" name="" id="checkbox">
                        <label for="checkbox" class="">请记住我</label>
                        <a for="" class="pull-right">忘记密码？</a>
                    </div>

                    <div class="">
                        <input type="button" class="btn btn-success form-control" value="登 录">
                    </div>
                </div>
            </form>
        </div>
        <p>
            没有账号？<a href="/register">点击注册</a>
        </p>
    </div>
</body>
<script src="../public/js/jquery-1.10.2.min.js"></script>
<script>
    // 输出文章中出现最多的英语单词
    function PrintMostWord(artical){
        // 合法性判断
        if(!artical) return; 
        // 初处理 去空格 转小写
        artical = artical.trim().toLowerCase();
        // 定义变量
        let Max_num = 0,
            Max_word = '',
            visited = [], // 计算过的单词表
            WordList = artical.match(/[a-z]+/g);
        // 前后添加空格，每个单词间添空格
        artical = " " + WordList.join(' ') + " ";

        WordList.forEach(item => {
            if(visited.indexOf(item) < 0){
                let reg = new RegExp(" " + item + " ",'g');
                let num = artical.match(reg).length;
                console.log(item,num)
                if(num > Max_num){
                    Max_num = num;
                    Max_word = item;
                }
                visited.push(item);
                console.log(visited)
            }
        });
        return {
            num: Max_num,
            word: Max_word
        };
    }
    console.log(PrintMostWord('hell jkalfd lkdl aa aa abc bb bb aal.'))

    if(!window.localStorage.Uer_email){
        $('email').val(window.localStorage.Uer_email);
    }       

</script>
</html>